package org.webdb.service;

import java.util.List;

import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.QueryParam;

import org.webdb.core.Document;
import org.webdb.core.Filter;
import org.webdb.core.Result;
import org.webdb.core.database.DataBase;
import org.webdb.core.database.Record;

public interface SearchDocumentService {

    @GET
    public List<Document> listDocuments(@PathParam("database") DataBase database);

    @GET
    @Path("{database}/{cluster}/{document}")
    public Result<Record> queryDocument(
            @PathParam("database") DataBase database,
            @PathParam("cluster") String clusterName,
            @PathParam("document") String documentName,
            @QueryParam("filter") Filter filter);

    @GET
    @Path("{database}/{document}")
    public Result<Record> queryDocument(
            @PathParam("database") DataBase database,
            @PathParam("document") String documentName,
            @QueryParam("filter") Filter filter);

}
